Skip to content

fix(lint): prefer MDN pages with single browser-compat value#29341

Open
caugner wants to merge 3 commits intomainfrom
29339-ignore-overview-pages-in-mdn-urls-linter
Open

fix(lint): prefer MDN pages with single browser-compat value#29341
caugner wants to merge 3 commits intomainfrom
29339-ignore-overview-pages-in-mdn-urls-linter

Conversation

@caugner
Copy link
Copy Markdown
Contributor

@caugner caugner commented Mar 25, 2026

Summary

Update the mdn-urls linter rules

  • Ignore overview pages (with browser-compat front matter).
  • Prefer pages with single browser-compat value.

Test results and supporting details

  • Ensure that BCD features whose key also appears in overview pages' frontmatter, still get the reference page as mdn_url.
  • Ensure that BCD features whose key appears on multiple reference pages, get the more specific reference page as mdn_url.

Related issues

Fixes #29339.

@caugner caugner requested a review from a team as a code owner March 25, 2026 14:03
@caugner caugner requested a review from LeoMcA March 25, 2026 14:03
@github-actions github-actions bot added infra Infrastructure issues (npm, GitHub Actions, releases) of this project data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API linter Issues or pull requests regarding the tests / linter of the JSON files. size:s [PR only] 7-24 LoC changed labels Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@github-actions github-actions bot added size:m [PR only] 25-100 LoC changed and removed size:s [PR only] 7-24 LoC changed labels Mar 26, 2026
@caugner caugner marked this pull request as draft March 26, 2026 10:33
@github-actions github-actions bot added the merge conflicts 🚧 This PR needs to merge latest "main" branch to resolve a merge conflict or other issue. label Mar 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@caugner caugner changed the title fix(lint): ignore overview pages in mdn-urls linter fix(lint): prefer MDN pages with single browser-compat value Mar 26, 2026
@caugner caugner force-pushed the 29339-ignore-overview-pages-in-mdn-urls-linter branch from 3c22802 to d28ce00 Compare March 26, 2026 19:00
@github-actions github-actions bot added size:xs [PR only] 0-6 LoC changed and removed merge conflicts 🚧 This PR needs to merge latest "main" branch to resolve a merge conflict or other issue. size:m [PR only] 25-100 LoC changed labels Mar 26, 2026
@caugner caugner marked this pull request as ready for review March 27, 2026 17:08
Comment on lines +74 to +77
const soleKeyEntries = entries.filter((e) => e.isSoleKey);
if (soleKeyEntries.length === 1) {
result.set(key, soleKeyEntries[0].slug);
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the last BCD meeting, we agreed to remove this complex part of the heuristic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API infra Infrastructure issues (npm, GitHub Actions, releases) of this project linter Issues or pull requests regarding the tests / linter of the JSON files. size:xs [PR only] 0-6 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-addition of mdn_url when multiple candidates in content inventory

2 participants